//  视频存储地址：https://cowtransfer.com/i/storage
function ybjcFn() {
  opemNewWindow(`file:///D:\健操/眼保健操${cycles++ % 3}.mp4`, false);
}
function gptc() {
  if (gptcMu.paused) {
    gptcMu.play();
    isPauseTo.innerHTML = '广播体操现在开始……';
    window.myGbtcFlag = false;
  } else {
    window.myGbtcFlag = true;
    gptcMu.pause();
    isPauseTo.innerHTML = '广播体操现在结束……';
  }
  gptcMu.addEventListener('pause', (event) => {
    if (!window.myGbtcFlag) {
      gqdtc();
      isPauseTo.innerHTML = '广播体操现在结束……';
    }
  });
}

function gptc2() {
  opemNewWindow('file:///D:\健操/第九套广播体操.mp4')
}

// 每两个小时活动一下
setInterval(() => {
  myCheckbox('tc') && gptc2()
}, 1000 * 60 * 60 * 2);

function gqdtc() {
  opemNewWindow('file:///D:\健操/高强度大课间操.mp4')
}

// 新闻联播：中午12点、晚上9点
let f = function () {
  let date = new Date(), cur = date.getTime(), url = 'https://tv.cctv.com/live/cctv13/index.shtml';
  let reserve12 = new Date(`${date.getFullYear()} ${date.getUTCMonth() + 1} ${date.getDate()} 12:00:00`).getTime();
  let reserve21 = new Date(`${date.getFullYear()} ${date.getUTCMonth() + 1} ${date.getDate()} 21:00:00`).getTime();
  reserve12 > cur && setTimeout(() => window.open(url, 'cctv'), reserve12 - cur);
  reserve21 > cur && setTimeout(() => window.open(url, 'cctv'), reserve21 - cur);
}
f(); setInterval(() => f(), 1000 * 60 * 60 * 24);

// 每天英语：早上10点、晚上10点半
let y = function () {
  let date = new Date(), cur = date.getTime(), url = 'https://www.duolingo.com/learn';
  let reserve12 = new Date(`${date.getFullYear()} ${date.getUTCMonth() + 1} ${date.getDate()} 10:00:00`).getTime();
  let reserve21 = new Date(`${date.getFullYear()} ${date.getUTCMonth() + 1} ${date.getDate()} 22:30:00`).getTime();
  reserve12 > cur && setTimeout(() => window.open(url, 'duolingo'), reserve12 - cur);
  reserve21 > cur && setTimeout(() => window.open(url, 'duolingo'), reserve21 - cur);
}
y(); setInterval(() => y(), 1000 * 60 * 60 * 24);
